This page last changed on Apr 09, 2007 by cholmes.

General help about how to create CoverageStores and Coverage is available in the base Geoserver help: 5 CoverageStore Configuration and 6 Coverage Config. They make use of GeoTIFF file format, which has all georeferencing metadata embedded into itself.

In order to create a coverage in Geoserver from a georeferenced TIFF (not a GeoTIFF) you need three files:

  1. the TIFF raster itself
  2. the World File (containing the georeferencing informations)
  3. the PRJ file (containing the SRS definition)

All files must have same name and different extension:

  1. .tif for the raster file
  2. .tfw for the World File
  3. .prj for the SRS definition file

The World File is an ASCII file containing data about pixel size, raster orientation, etc. A more in-depth discussion about this topic in Geoserver is WorldImage CoverageStore. A reference page is available here: http://www.gdal.org/frmt_various.html#WLD

The PRJ (SRS definition) file is another ASCII file needed by the Geoserver WCS module to properly handle the raster: without this file Geoserver isn't able to configure the Coverage and the raster gets a wrong spatial position. Hand-creating this file is very simple: it contains only one line with the WKT of the SRS (the Well Known Text is a standard textual representation of an SRS: Geoserver comes with a complete database of SRS definition, accessible from the main webadmin page). Please keep attention while creating the prj file: the WKT has to be exactly in one line.

As usual, you can put all three files somewhere on the server's filesystem, then configure the CoverageStore this way:

  • Coverage Data Set Description: "A raster file accompanied by a spatial data file"
  • URL: path to the tif file (the tfw and prj files have to be in the same directory)

After configuring the CoverageStore, you can create the Coverage (refer to the above help page for details).

At time of writing there is a relevant issue open, about TIFF+TFW with a rotation angle different from zero: http://jira.codehaus.org/browse/GEOS-928

Keep also in mind that TIFF+TFW are not really meant for high performance. Often the best solution is to use the GeoTIFF format.
There is an open source tool to convert from a TIFF+TFW to a GeoTIFF raster: the GDAL library (in particular, you need the gdal_translate command).

Given a tif+tfw (gdal_translate doesn't seem to make use of the prj file), you can issue this command (of course on one line: here it's split for readability):

gdal_translate
  -of GTiff
  -co "PROFILE=GeoTIFF"
  -co "INTERLEAVE=PIXEL"
  -co "COMPRESS=LZW"
  -co "TILED=YES"
  -a_srs EPSG:4326
  raster_with_world_file.tif raster_geotiff.tif

(the prj file is replaced by the -a_srs option).

As usual, you must have a file named raster_with_world_file.tfw in the same directory.

Geoserver gurus tell me it's a good thing to create overview images (to increase performance), but I still haven't tried that (it should involve use of the gdaladdo utility - if someone already used it, he/she's welcome updating this tutorial ).

At time of writing, the gdal_translate command doesn't seem complete: the produced GeoTIFF lacks of georeferencing metadata so Geoserver isn't able to create the CoverageStore (throwing a NullPointerException chained with a GeoTiffException).

Work is in progress to further investigate the issue.

Posted by fabiodasoghe at Mar 08, 2007 08:42
Document generated by Confluence on Jan 16, 2008 23:28